<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //能耗
        {
            let myChart = echarts.init(document.getElementById('chart-intelligence-energy'));
            let dataX = ['01周', '02周', '03周', '04周', '05周', '06周', '07周', '08周', '09周', '10周', '11周', '12周', '13周', '14周', '15周'];
            let data1 = [500, 600, 700, 800, 500, 600, 600, 500, 600, 700, 800, 500, 600, 600, 600];
            let data2 = [30, 160, 170, 120, 90, 60, 20, 30, 20, 80, 150, 160, 120, 60, 60];
            myChart.setOption(createDoubleLineOption({ dataX: dataX, data1: data1, data2: data2, labelY1: '(万kWh)', labelY2: '(t)', label1: '用电量', label2: '用水量' }));

        }
        {
            let myChart = echarts.init(document.getElementById('chart-main-energy'));
            let dataX = ['01周', '02周', '03周', '04周', '05周', '06周', '07周', '08周', '09周', '10周', '11周', '12周', '13周', '14周', '15周'];
            let data1 = [500, 600, 700, 800, 500, 600, 600, 500, 600, 700, 800, 500, 600, 600, 600];
            let data2 = [30, 160, 170, 120, 90, 60, 20, 30, 20, 80, 150, 160, 120, 60, 60];
            myChart.setOption(createDoubleLineOption({ dataX: dataX, data1: data1, data2: data2, labelY1: '(万kWh)', labelY2: '(t)', label1: '用电量', label2: '用水量' }));

        }
        operationData = [
            { label: '日常巡检', value: '140次', icoUrl: '../img/main/mile-icon.png' },
            { label: '缺陷上报', value: '12次', icoUrl: '../img/main/faults.png' },
            { label: '缺陷维修', value: '12次', icoUrl: '../img/main/tools.png' },
            { label: '任务工单', value: '5次', icoUrl: '../img/main/paperClip.png' },
            { label: '专项保养', value: '24次', icoUrl: '../img/main/paper.png' },
        ]
        operationData.forEach(item => {
            var option = $.extend({}, item);
            //获取组件后放入组件注册表
            components[option.name] = $('#container-operation-count').labelIconValue(option);
            components[option.name] = $('#container-operation-count-2').labelIconValue(option);
        })
        {
            let data1 = [
                { value: 15, name: '物联网上报' },
                { value: 10, name: '人工上报' },
                { value: 6, name: 'AI上报' },
                { value: 6, name: '业主上报' },
            ]
            let data2 = [
                { value: 15, name: '已处理' },
                { value: 10, name: '未处理' },
                // { value: 6, name: '排水系统' },
                // { value: 6, name: '消防系统' },
                // { value: 3, name: '照明系统' },

            ]
            let myChart1 = echarts.init(document.getElementById('chart-tunnel-alarm1'));
            let myChart2 = echarts.init(document.getElementById('chart-tunnel-alarm2'));
            myChart1.setOption(createPieOption({ data: data1, line: 1 }));
            myChart2.setOption(createPieOption({ data: data2, line: 1 }));

        }
        {
            let data = [
                { value: 35, name: '物联网上报' },
                { value: 10, name: '人工上报' },
                { value: 35, name: 'AI上报' },
                { value: 10, name: '业主上报' },

            ]
            let myChart = echarts.init(document.getElementById('chart-intelligence-faults-count'));
            myChart.setOption(createPieOption({ data: data, line: 1 }));
        }
        personIntelligenceData.forEach(item => {
            var option = $.extend({}, item);
            //获取组件后放入组件注册表
            components[option.name] = $('#container-table-intelligence-person').formcell(option);
        })
        carStatisticsData.forEach(item => {
            var option = $.extend({}, item);
            //获取组件后放入组件注册表
            components[option.name] = $('#container-table-car').formcell(option);
        })

        countCar = [
            { label: '当前运行车辆', value: '03', unit: '辆' },
        ]
        countCar.forEach(item => {
            var option = $.extend({}, item);
            //获取组件后放入组件注册表
            components[option.name] = $('#count-car').lightLabelValue(option);
        })
        toolStatisticsData.forEach(item => {
            var option = $.extend({}, item);
            //获取组件后放入组件注册表
            components[option.name] = $('#container-table-tool').formcell(option);
        })

        countTool = [
            { label: '今日借出', value: '8', unit: '件' },
            { label: '今日归还', value: '8', unit: '件' },
            { label: '当前借出', value: '12', unit: '件' },
            { label: '库存总数', value: '158', unit: '件' },
        ]
        countTool.forEach(item => {
            var option = $.extend({}, item);
            //获取组件后放入组件注册表
            components[option.name] = $('#count-tool').lightLabelValue(option);
        })
        countSpare = [
            { label: '本月出库数量', value: '18', unit: '件' },
            { label: '本月入库数量', value: '18', unit: '件' },
            { label: '库存总数', value: '1158', unit: '件' },
        ]
        countSpare.forEach(item => {
            var option = $.extend({}, item);
            //获取组件后放入组件注册表
            components[option.name] = $('#count-spare').lightLabelValue(option);
        })
        spareStatisticsData = [
            { name: '三相三线智能电能表', num: { value: '5件', 'color': 'rgb(255, 54, 54)' }, type: '低库存' },
            { name: '综合继电保护器', num: { value: '10件', 'color': 'rgb(255, 54, 54)' }, type: '低库存' },
            { name: '10KV真空断路器', num: { value: '18件', 'color': 'rgb(255, 54, 54)' }, type: '低库存' },
            { name: '塑壳开关', num: { value: '122件', 'color': 'orange' }, type: '高库存' },
            { name: '双电源转换开关', num: { value: '322件', 'color': 'orange' }, type: '高库存' },
            { name: '电池', num: { value: '322件', 'color': 'orange' }, type: '高库存' },
            { name: '隔离手车', num: { value: '322件', 'color': 'orange' }, type: '高库存' },
            { name: '充电模块', num: { value: '322件', 'color': 'orange' }, type: '高库存' },

        ]
        spareStatisticsData.forEach(item => {
            var option = $.extend({}, item);
            //获取组件后放入组件注册表
            components[option.name] = $('#container-table-spare').formcell(option);
        })
        totalAverageHoursData = [
            { label1: '巡检工单总工时', value1: '722.2h', label2: '工单数', value2: '140', label3: '平均工时', value3: '5.2h' },
            { label1: '任务工单总工时', value1: '92.5h', label2: '工单数', value2: '5', label3: '平均工时', value3: '18.5h' },
            { label1: '维修工单总工时', value1: '61.0h', label2: '工单数', value2: '12', label3: '平均工时', value3: '5.1h' },
            { label1: '缺陷上报总响应时间', value1: '6.0h', label2: '工单数', value2: '12', label3: '平均工时', value3: '0.2h' },
        ]
    </script>
</body>

</html>